<script type="text/javascript">
				$(document).ready(function () {
					try
					{
						var theme = getTheme();
						var alto = 90;
						
						
					    var grid = '#jqxGrid';        	
						
						var url = '/listados/comunicatsjson/';
						
						//prepare the data
					    var source =
					    {
					        datatype: 'json',
					        datafields: [
					        	{ name: 'id_producto' },
					            { name: 'titulo' },                    
					            { name: 'descripcion' },
					            { name: 'empresa'},
					            { name: 'contacto'}
					            ],
					        id: 'id_producto',
					        url: url,
					        root: 'data'
					    };
					    
					    var dataAdapter = new $.jqx.dataAdapter(source);
					
					    $(grid).jqxGrid(
					    {
					        width: '99%',
					        height: '92%',
					        source: dataAdapter,
					        theme: theme,
					        pagesize: 25,
					        pagesizeoptions: ['25', '50', '75'],
					        sortable: true,
					        pageable: true,
					        filterable: true,                
					        columnsresize: false,
					        altrows: true,
					        scrollbarsize: 15,
					        columns: [
					          { text: 'ID Comunicat', dataField: 'id_producto', width: 85, cellsalign: 'right' },
					          { text: 'Títol', dataField: 'titulo', minwidth: 140 },
					          { text: 'Descripció', dataField: 'descripcion', width: 280 },
					          { text: 'Empresa', dataField: 'empresa', width: 180 },
					          { text: 'Contacte', dataField: 'contacto', width: 180, cellsalign: 'left' }
					        ]
					    });
					    
						//Double Click
						$('#jqxGrid').bind('rowdoubleclick', function (event) 
						{
							var	id = valorGridIdUnico($('#jqxGrid'), 'id_producto');
							location = '/admin/comunicats-detall/value/'+id+'/';
						});

						$('#eliminar').click(function(){
							if(!eliminaRegistro('productes'))
								$("#jqxGrid").jqxGrid({ source: source });
						});

						$('#jqxNavigationBar').jqxNavigationBar('expandAt', 1); 
					}
					catch(err)
					{
					}
				});
			</script>
			<div id='jqxTabs'>
				<ul>
					<li>Llistat comunicats</li>
				</ul>
				<div>
					<input type="button" id="nueva" value="Nou comunicat" style="margin:6px 0;" onclick="location='/admin/comunicats-detall/value/'">
					<input type="button" id="eliminar" value="Esborrar registre" />
					<div id="jqxGrid"></div>
				</div>
			</div>